import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProcurementComponent } from './pages/procurement/procurement.component';
import { ProcurementDetailComponent } from './pages/procurement-detail/procurement-detail.component';
import { SingleDetailComponent } from './pages/single-detail/single-detail.component';
import { SingleComponent } from './pages/single/single.component';
import { AdjustComponent } from './pages/adjust/adjust.component';
import { AdjustDetailComponent } from './pages/adjust-detail/adjust-detail.component';
import { CollectionComponent } from './pages/collection/collection.component';
import { CollectionDetailComponent } from './pages/collection-detail/collection-detail.component';
const routes: Routes = [
    {
        path: 'procurement',
        component: ProcurementComponent,
        data: { breadcrumbs: [{ title: '采购付款' }] },
        children: [
            {
                path: 'detail/:id',
                component: ProcurementDetailComponent,
                data: { breadcrumbs: [{ title: '采购付款列表', path: '/financial/procurement' }, { title: '采购详情' }] },
            },
            {
                path: 'detail',
                component: ProcurementDetailComponent,
                data: { breadcrumbs: [{ title: '采购付款列表', path: '/financial/procurement' }, { title: '添加采购' }] },
            },
        ]
    },
    {
        path: 'borrow',
        component: SingleComponent,
        children: [
            {
                path: 'detail', component: SingleDetailComponent, data: {
                    breadcrumbs: [{ title: '借支单列表', path: '/financial/borrow' }, { title: '添加借支单' }]
                },
            },
            {
                path: 'detail/:id', component: SingleDetailComponent, data: {
                    breadcrumbs: [{ title: '借支单列表', path: '/financial/borrow' }, { title: '借支单详情' }]
                }
            },
        ],
        data: {
            breadcrumbs: [{ title: '借支单列表' }]
        }
    },
    {
        path: 'adjust',
        component: AdjustComponent,
        data: { breadcrumbs: [{ title: '调整单列表' }] },
        children: [
            {
                path: 'detail/:id',
                component: AdjustDetailComponent,
                data: { breadcrumbs: [{ title: '调整单列表', path: '/financial/adjust' }, { title: '调整单详情' }] },
            },
            {
                path: 'detail',
                component: AdjustDetailComponent,
                data: { breadcrumbs: [{ title: '调整单列表', path: '/financial/adjust' }, { title: '添加调整单' }] },
            },
        ]
    },
    {
        path: 'collection',
        component: CollectionComponent,
        data: { breadcrumbs: [{ title: '收款列表' }] },
        children: [
            {
                path: 'detail/:id',
                component: CollectionDetailComponent,
                data: { breadcrumbs: [{ title: '收款列表', path: '/financial/collection' }, { title: '收款详情' }] },
            },
            {
                path: 'detail',
                component: CollectionDetailComponent,
                data: { breadcrumbs: [{ title: '收款列表', path: '/financial/collection' }, { title: '添加收款' }] },
            },
        ]
    },

];

export const declarationComponents = [
    ProcurementComponent,
    ProcurementDetailComponent,
    SingleComponent,
    SingleDetailComponent,
    AdjustComponent,
    AdjustDetailComponent,
    CollectionDetailComponent,
    CollectionComponent
];

export const entryComponents = [
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class FinancialRoutingModule { }
